<template>
  <s-layout title="分享海报" class="set-userinfo-wrap">
	<view class="wrap">
		<su-swiper autoplay="true"   @change="swiperChange"  :circular="true" :list="list"></su-swiper>
	</view>
	
	<view @click="shengchhb()" class="shenghaibao">生成海报</view>
	 </s-layout>
</template>

<script setup>
	  import sheep from '@/sheep';
	    import { computed, reactive, ref, unref } from 'vue';
		 const shareConfig = computed(() => sheep.$store('app').platform.share);
	import { onShow } from '@dcloudio/uni-app';
	
		const current = ref(0)
		const list = ref([])
		
		const index=0;
	

const shengchhb=async () => {
	sheep.$router.go('action:showShareModal')
}

  // current 改变时会触发 change 事件
  const swiperChange = (e) => {
  console.log(e)
  };
	  
  const onSearch = async () => {
		const { data } = await sheep.$api.user.huoquhaibao()
		
		list.value=data;
		shareConfig.value.posterInfo.user_bg=list.value[0]['src'];
		
	}   

	
	onShow(() => {
		onSearch()
	});
</script>

<style lang="scss" scoped>
	.wrap {
	
		padding: 10rpx 20rpx;
		border-radius: 5rpx;
		border:#fff solid 10rpx
	}
	.shenghaibao{
		position: fixed;
		bottom: 10rpx;
		width: 90%;
		height: 90rpx;
		margin: 3% 5%;
		line-height: 90rpx;
		background: #03A2FD;
		color: #fff;
		text-align: center;
		border-radius: 20rpx;
	}
</style>